package com.central.scheduler.dao.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.central.common.enums.TaskType;
import com.central.common.handler.ListLongToStringHandler;
import com.central.common.handler.ListWorkerServerToStringHandler;
import com.central.common.model.SuperEntity;
import com.central.common.model.WorkerServer;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.ibatis.type.JdbcType;

import java.util.List;

import static com.baomidou.mybatisplus.annotation.FieldStrategy.NOT_NULL;

/**
 * @author Tindy
 * @date 2021/11/23
 * @describe
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "sch_worker_group",autoResultMap = true)
public class WorkerGroup extends SuperEntity {
    private String name;
    private Long proId;
    @TableField(jdbcType = JdbcType.VARCHAR, insertStrategy = NOT_NULL, typeHandler = ListLongToStringHandler.class)
    private List<Long> workerIds;
    @TableField(jdbcType = JdbcType.VARCHAR, insertStrategy = NOT_NULL, typeHandler = ListWorkerServerToStringHandler.class)
    private List<WorkerServer> workerServers;
    private TaskType taskType;
}
